package com.example.bidding.web;

import com.example.bidding.service.OrderService;
import com.example.common.entity.Rsp;
import com.example.common.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("orders")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("createOrder")
    public Rsp createOrder(@RequestHeader("Authorization")String token){
        return orderService.createOrder(token);
    }

    @PostMapping("queryOrderStatus")
    public Rsp queryOrderStatus(@RequestBody Order order){

        return orderService.queryOrderStatusFromDB(order.getOrderNum());
    }
}
